from apps.common.base.dao import BaseDao
from apps.account.serializers import *

class AccountDao(BaseDao):
    MODEL_CLASS = Account
    SERI_CLASS = AccountBaseSerializer

    def replaceToken(self, userId):

        old_token = Token.objects.filter(user_id=userId)
        old_token.delete()
        token = Token.objects.create(user_id=userId)

        return token